<include file="Public:header" />
<div id="main" class="main" >
<div class="content">
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/Js/editor/kindeditor.js"></script>
<script type="text/javascript">
    KE.show({
        id : 'content_1' //TEXTAREA输入框的ID
   });
</script>
<div class="title">编辑数据 [ <a href="__URL__">返回列表</a> ]</div>
<div class="fRig"><neq name="vo.image" value=''><img src="__PUBLIC__/Uploads/{$vo.image}"  width="160" height="120" style="border:1px solid silver;padding:1px" /></neq></div>
<div id="result" class="result none"></div>
<form method='post' id="form1" name="form1"action="__URL__/update"  enctype="multipart/form-data">
<table cellpadding=3 cellspacing=3>
<tr>
	<td class="tRight" width="10%">试题名称：</td>
	<td class="tLeft" ><input type="text" class="huge bLeftRequire" name="title" value="{$vo.title}"></td>
</tr>
<tr>
	<td class="tRight" width="10%">分类：</td>
	<td class="tLeft" >
		<select name="type" onchange="displayarea(this.options[this.options.selectedIndex].value)">
		<option value="1" <if condition="$vo.type == 1">selected</if> >单选</option>
		<option value="2" <if condition="$vo.type == 2">selected</if> >多选</option>
        <option value="3" <if condition="$vo.type == 3">selected</if> >是非</option>
		</select>
	</td>
</tr>
</table>
<div id="radioArea" <if condition="$vo.type == 1">style="display:block"<else />style="display:none"</if> >
<table>
<tr>
	<td class="tRight tTop">单选答案一：</td>
	<td class="tLeft"><input class="huge bLeftRequire" type="text" name="option1" value="{$vo[option][0]}">&nbsp;&nbsp;<input type="radio" name="answer" value="0"  <?php if(in_array(0,$answer)){echo 'checked';} ?> />正确答案</td>
</tr>
<tr>
	<td class="tRight tTop">单选答案二：</td>
	<td class="tLeft"><input class="huge bLeftRequire" type="text" name="option2" value="{$vo[option][1]}">&nbsp;&nbsp;<input type="radio" name="answer" value="1"  <?php if(in_array(1,$answer)){echo 'checked';} ?> />正确答案</td>
</tr>
<tr>
	<td class="tRight tTop">单选答案三：</td>
	<td class="tLeft"><input class="huge bLeftRequire" type="text" name="option3" value="{$vo[option][2]}">&nbsp;&nbsp;<input type="radio" name="answer" value="2"  <?php if(in_array(2,$answer)){echo 'checked';} ?> />正确答案</td>
</tr>
<tr>
	<td class="tRight tTop">单选答案四：</td>
	<td class="tLeft"><input class="huge bLeftRequire" type="text" name="option4" value="{$vo[option][3]}">&nbsp;&nbsp;<input type="radio" name="answer" value="3"  <?php if(in_array(3,$answer)){echo 'checked';} ?> />正确答案</td>
</tr>
</table>
</div>
<div id="boolArea" <if condition="$vo.type == 3">style="display:block"<else />style="display:none"</if> >
<table>
<tr>
	<td class="tRight tTop">是非选项一：</td>
	<td class="tLeft"><input class="huge bLeftRequire" type="text" name="option1" value="{$vo[option][0]}">&nbsp;&nbsp;<input type="radio" name="ranswer" value="0"  <?php if(in_array(0,$answer)){echo 'checked';} ?> />正确答案</td>
</tr>
<tr>
	<td class="tRight tTop">是非选项二：</td>
	<td class="tLeft"><input class="huge bLeftRequire" type="text" name="option2" value="{$vo[option][1]}">&nbsp;&nbsp;<input type="radio" name="ranswer" value="1"  <?php if(in_array(1,$answer)){echo 'checked';} ?> />正确答案</td>
</tr>
</table>
</div>
<div id="checkboxArea" <if condition="$vo.type == 2">style="display:block"<else />style="display:none"</if> >
<table>
<tr>
	<td class="tRight tTop">多选答案一：</td>
	<td class="tLeft"><input class="huge bLeftRequire" type="text" name="moption1" value="{$vo[option][0]}">&nbsp;&nbsp;<input type="checkbox" name="manswer[]" value="0" <?php if(in_array(1,$answer)){echo 'checked';} ?> />正确答案</td>
</tr>
<tr>
	<td class="tRight tTop">多选答案二：</td>
	<td class="tLeft"><input class="huge bLeftRequire" type="text" name="moption2" value="{$vo[option][1]}">&nbsp;&nbsp;<input type="checkbox" name="manswer[]" value="1" <?php if(in_array(2,$answer)){echo 'checked';} ?>  />正确答案</td>
</tr>
<tr>
	<td class="tRight tTop">多选答案三：</td>
	<td class="tLeft"><input class="huge bLeftRequire" type="text" name="moption3" value="{$vo[option][2]}">&nbsp;&nbsp;<input type="checkbox" name="manswer[]" value="2" <?php if(in_array(3,$answer)){echo 'checked';} ?>  />正确答案</td>
</tr>
<tr>
	<td class="tRight tTop">多选答案四：</td>
	<td class="tLeft"><input class="huge bLeftRequire" type="text" name="moption4" value="{$vo[option][3]}">&nbsp;&nbsp;<input type="checkbox" name="manswer[]" value="3" <?php if(in_array(4,$answer)){echo 'checked';} ?>  />正确答案</td>
</tr>
</table>
</div>
<table>
<tr>
	<td></td>
	<td class="center"><div style="width:85%;margin:5px">
	<input type="hidden" class="huge bLeftRequire" name="id" value="{$vo.id}">
	<input type="submit" value="更 新" class="button medium">
	</div></td>
</tr>
</table>
</form>
</div>
</div>
<script>
function displayarea(id){
    var areaId = id;
    var radioArea = document.getElementById('radioArea');
    var checkboxArea = document.getElementById('checkboxArea');
	var boolArea = document.getElementById('boolArea');
    if(areaId == 1){
    	radioArea.style.display = 'block';
	    checkboxArea.style.display = 'none';
		boolArea.style.display = 'none';
    }else if(areaId == 2){
	    checkboxArea.style.display = 'block';
	    radioArea.style.display = 'none';
		boolArea.style.display = 'none';
	}else if(areaId == 3){
		boolArea.style.display = 'block';
	    checkboxArea.style.display = 'none';
	    radioArea.style.display = 'none';
	}
}
</script>
